begintownscript;
variables;
    int fx = 0, fy = 0;
body;
beginstate INIT_STATE;
    set_name(6, "Marcus");
    set_name(13, "Faradoc");
    set_name(19, "Bandhalf");
    set_name(20, "Zery");
    if ((get_current_tick() < 625) || (get_current_tick() > 4375) &&
         (get_current_tick() < 5000 + 625) || (get_current_tick() > 5000 + 4375) &&
         (get_current_tick() < 10000 + 625) || (get_current_tick() > 10000 + 4375) &&
         (get_current_tick() < 15000 + 625) || (get_current_tick() > 15000 + 4375) &&
         (get_current_tick() < 20000 + 625) || (get_current_tick() > 20000 + 4375) &&
         (get_current_tick() < 25000 + 625) || (get_current_tick() > 25000 + 4375))
         set_state_continue(50);
break;
beginstate EXIT_STATE;

break;
beginstate START_STATE;
    if ((get_current_tick() < 625) || (get_current_tick() > 4375) &&
         (get_current_tick() < 5000 + 625) || (get_current_tick() > 5000 + 4375) &&
         (get_current_tick() < 10000 + 625) || (get_current_tick() > 10000 + 4375) &&
         (get_current_tick() < 15000 + 625) || (get_current_tick() > 15000 + 4375) &&
         (get_current_tick() < 20000 + 625) || (get_current_tick() > 20000 + 4375) &&
         (get_current_tick() < 25000 + 625) || (get_current_tick() > 25000 + 4375))
         set_state_continue(50);
    if (get_ran(1, 0, 10) < 7)
         text_bubble_on_char(6, "I have been expecting you.");
    else text_bubble_on_char(6, "Welcome.");
break;
beginstate 10;
    if (get_flag(10, 0) == 0)
        message_dialog("Though there is less traffic in the eastern part of the city it is not more quiet than the rest.", "Now you can hear loud and clear the birdsong and the silent flow of the water. This is definetly the most beautiful part of the city.");
    set_flag(10, 0, 1);
        
break;
beginstate 11;
    if (get_flag(10, 1) == 0)
        message_dialog("There has recently been an explosion in this wizard's hut. It also looks like this wizard had many tables full of lab equipment and beakers near the explosion source.", "As a result, the mess in the house is complete.");
    set_flag(10, 1, 1);
break;
beginstate 12;
    if (get_flag(10, 2) == 0)
        message_dialog("The first thing you hear when you enter the castle hall is the echo of your footsteps.", "There are lots of chairs and two tables. You cach glimpses of bowmen up on the walls.");
    set_flag(10, 2, 1);
break;
beginstate 13;
    if (in_boat() != -1)
        move_to_new_town(3, 56, 33);
    else move_to_new_town(3, 56, 31);
break;
beginstate 14;

break;
beginstate 50;
       while (fy < 48)
         {
         if (get_terrain(fx, fy) == 480)
             set_terrain(fx, fy, 209);
         fx = fx + 1;
         if (fx == 48)
             {
             fx = 0;
             fy = fy + 1;
             }
         }
break;